import { CustomEnum } from "@/enums";

export function getLabelByValue(constant: CustomEnum<any>, value: number): string {
  const element = Object.values(constant).find((item) => item.value === value);
  if (!element) return "--";
  return element.label;
}

export function getLabelValueList(constant: CustomEnum<any>): Array<string> {
  return Object.values(constant);
}
